<?php
/**
* @file $Id: ChooseRequest.php 283 2006-11-15 03:57:25Z focus-sis $
* @package Focus/SIS
* @copyright Copyright (C) 2006 Andrew Schmadeke. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* Focus/SIS is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.txt for copyright notices and details.
*/


$_REQUEST['modfunc'] = 'choose_course';

if($_REQUEST['course_id'])
{
	$weights_RET = DBGet(DBQuery("SELECT COURSE_WEIGHT,GPA_MULTIPLIER FROM COURSE_WEIGHTS WHERE COURSE_ID='$_REQUEST[course_id]'"));
	if(count($weights_RET)==1)
		$_REQUEST['course_weight'] = $weights_RET[1]['COURSE_WEIGHT'];
}

if(!$_REQUEST['course_weight'])
	include $staticpath.'modules/Scheduling/Courses.php';
else
{
	$course_title = DBGet(DBQuery("SELECT TITLE FROM COURSES WHERE COURSE_ID='".$_REQUEST['course_id']."'"));
	$course_title = $course_title[1]['TITLE'] . ' - ' . $_REQUEST['course_weight'] . '<INPUT type=hidden name=request_course_id value='.$_REQUEST['course_id'].'><INPUT type=hidden name=request_course_weight value='.$_REQUEST['course_weight'].'>';

	echo "<script language=javascript>opener.document.getElementById(\"weight_div\").innerHTML = \"$course_title<BR><small><INPUT type=checkbox name=not_request_course value=Y>"._('Not Requested')."</small>\"; window.close();</script>";
}

?>